package com.kaibo.roomdemo.data.bean

import android.databinding.BaseObservable
import android.databinding.Bindable
import android.graphics.Color
import android.support.annotation.ColorInt
import com.android.databinding.library.baseAdapters.BR
import com.kaibo.roomdemo.annotation.PoKo

/**
 * @author Administrator
 * @date 2018/2/14 0014 上午 11:18
 * GitHub：
 * email：
 * description：
 */

@PoKo
class ItemDemoBean : BaseObservable() {

    @ColorInt
    var itemBgColor: Int = Color.WHITE
        set(value) {
            field = value
            notifyPropertyChanged(BR.itemBgColor)
        }
        @Bindable
        get() {
            return field
        }

    var name: String = ""
        set(value) {
            field = value
            notifyPropertyChanged(BR.name)
        }
        @Bindable
        get() {
            return field
        }
    @ColorInt
    var nameTextColor: Int = Color.RED
        set(value) {
            field = value
            notifyPropertyChanged(BR.nameTextColor)
        }
        @Bindable
        get() {
            return field
        }

    var age: Int = 0
        set(value) {
            field = value
            notifyPropertyChanged(BR.age)
        }
        @Bindable
        get() {
            return field
        }
    @ColorInt
    var ageTextColor: Int = Color.RED
        set(value) {
            field = value
            notifyPropertyChanged(BR.ageTextColor)
        }
        @Bindable
        get() {
            return field
        }

    var address: String = ""
        set(value) {
            field = value
            notifyPropertyChanged(BR.address)
        }
        @Bindable
        get() {
            return field
        }
}